package net.neptech.utils;

import cn.hutool.core.util.IdUtil;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.id.IdentifierGenerator;

import java.io.Serializable;

/**
 * @Author Saya
 * @Date 2025/8/12 16:18
 * @Description TODO
 **/
public class SnowflakeIdGenerator implements IdentifierGenerator {
    @Override
    public Serializable generate(SharedSessionContractImplementor session, Object o) {
        return IdUtil.getSnowflake(1).nextId();
    }
}
